import { Action } from '@ngrx/store';
/*** 用户相关
* */

// 保存认证状态
export const RESET_AUTHENTICATE_STORE= 'RESET_AUTHENTICATE_STORE';

// 保存认证状态
export const SAVE_AUTHENTICATE_STATUS= 'SAVE_AUTHENTICATE_STATUS';

// 个人信息
export const UPDATE_CARD_INFO= 'UPDATE_CARD_INFO'; // 得到身份证信息
export const UPDATE_FACE_CONTRAST= 'UPDATE_FACE_CONTRAST'; // 更新比对阈值

export const BIND_USER_INFO_SUCCESS= 'BIND_USER_INFO_SUCCESS'; // 更新验证状态
export const UPDATE_USER_INFO= 'UPDATE_USER_INFO'; // 更新学历地址

// 联系人
export const UPDATE_CONTACTS= 'UPDATE_CONTACTS';

// 银行卡
export const BIND_BANK_CARD_SUCCESS= 'BIND_BANK_CARD_SUCCESS'; // 成功

// 运营商
export const GET_MOBILE_TOKEN= 'GET_MOBILE_TOKEN'; // 获取token成功
// const NEED_SEND_MSG_CODE= 'NEED_SEND_MSG_CODE'; // 需要发送验证码才有此状态
export const BIND_TELEPHONE_SUCCESS= 'BIND_TELEPHONE_SUCCESS'; // 成功

// 工作信息
export const UPLOAD_WORK_IMGS_SUCCESS= 'UPLOAD_WORK_IMGS_SUCCESS'; // 上传工作照成功
export const UPDATE_WORK_INFO_SUCCESS= 'UPDATE_WORK_INFO_SUCCESS'; // 成功

// 更多信息
export const UPDATE_MORE_INFO= 'UPDATE_MORE_INFO'; // 成功

export class ResetAuthStoreAction implements Action {
  readonly type= RESET_AUTHENTICATE_STORE;
}

export class SaveAuthStatusAction implements Action {
  readonly type= SAVE_AUTHENTICATE_STATUS;
  constructor(public payload: any) {}
}

export class UpdateCardInfoAction implements Action {
  readonly type= UPDATE_CARD_INFO;
  constructor(public payload: any) {}
}

export class UpdateFaceContrastAction implements Action {
  readonly type= UPDATE_FACE_CONTRAST;
  constructor(public payload: any) {}
}

export class BindUserInfoAction implements Action {
  readonly type= BIND_USER_INFO_SUCCESS;
  constructor(public payload: any) {}
}

export class UpdateUserInfoAction implements Action {
  readonly type= UPDATE_USER_INFO;
  constructor(public payload: any) {}
}

export class UpdateContactsAction implements Action {
  readonly type= UPDATE_CONTACTS;
  constructor(public payload: any) {}
}

export class BindBankCardAction implements Action {
  readonly type= BIND_BANK_CARD_SUCCESS;
  constructor(public payload: any) {}
}

export class GetMobileTokenAction implements Action {
  readonly type= GET_MOBILE_TOKEN;
  constructor(public payload: any) {}
}

export class BindTelephoneAction implements Action {
  readonly type= BIND_TELEPHONE_SUCCESS;
  constructor(public payload: any) {}
}

export class UploadWorkImgsAction implements Action {
  readonly type= UPLOAD_WORK_IMGS_SUCCESS;
  constructor(public payload: any) {}
}

export class UpdateWorkInfoAction implements Action {
  readonly type= UPDATE_WORK_INFO_SUCCESS;
  constructor(public payload: any) {}
}

export class UpdateMoreInfoAction implements Action {
  readonly type= UPDATE_MORE_INFO;
  constructor(public payload: any) {}
}

export type All= ResetAuthStoreAction | SaveAuthStatusAction | UpdateCardInfoAction
  | UpdateFaceContrastAction | BindUserInfoAction | UpdateUserInfoAction
  | UpdateContactsAction | BindBankCardAction | GetMobileTokenAction
  | BindTelephoneAction | UploadWorkImgsAction | UpdateWorkInfoAction
  | UpdateMoreInfoAction;
